<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<script type="text/javascript" src="/js/common/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="/js/common/jquery.url.js"></script>

	

</head>
<body>
<ul class="depth_1">
				<li><a href="#manage"><img id="status" src="images/menu1_on.jpg" alt="현황판" /></a></li>
				<li><a href="#system"><img id="system" src="images/menu2.jpg" alt="시스템" /></a></li>
				<li><a href="#system"><img id="user" src="images/menu9.jpg" alt="사용자" /></a></li>
				<li><a href="#basic"><img id="policy" src="images/menu3.jpg" alt="정책" /></a></li>
				<li><a href="#"><img id="account" src="images/menu4.jpg" alt="계정" /></a></li>
				<li><a href="#command"><img id="auth" src="images/menu5.jpg" alt="권한" /></a></li>
				<li><a href="#work"><img id="work" src="images/menu6.jpg" alt="작업" /></a></li>
				<li><a href="#session"><img id="session" src="images/menu7.jpg" alt="세션" /></a></li>
				<li><a href="#log"><img id="log" src="images/menu8.jpg" alt="로그" /></a></li>
			</ul>
<script type="text/javascript">
$(document).ready(function(){
	//메뉴 활성화
	//url 추출
	var url = $.url();
	seg = url.segment(url.segment().length-1);
	$("ul.depth_1 > li > a > img").each(function( index ) {
		var src = $(this).attr("src");
		var id = $(this).attr("id");
		var srcArray = new Array(3);
		srcArray[0] = src.substring(0,src.lastIndexOf("/"));
		srcArray[1] = src.substring(src.lastIndexOf("/")+1,src.lastIndexOf(".")).replace("_on","");
		srcArray[2] = src.substring(src.lastIndexOf(".")+1,src.length);
		
		if( id == seg ) {
			srcArray[1] = srcArray[1] + "_on";
		}
		$(this).attr("src",srcArray[0]+"/"+srcArray[1]+"."+srcArray[2]);
		
		//대메뉴 이미지마다 클릭이벤트 연결
		$(this).on("click", function(event){
			var subId = $(this).parent().attr("href").replace("#","");
			location.href = "/jsp/"+id+"/"+subId+".jsp";	
		});
	});
	
	$("ul.depth_2 > li > a > img").each(function( index ) {
		//대메뉴 이미지마다 클릭이벤트 연결
		var id = $(this).attr("id");
		$(this).on("click", function(event){
			var subId = $(this).parent().attr("href").replace("#","");
			location.href = "/jsp/"+id+"/"+subId+".jsp";	
		});
	});
});
</script>
</body>
</html>